// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]

mod debug;
mod deserialize;
mod serialize;

/// This proto includes every type of field in both singular and repeated
/// forms.
///
/// Also, crucially, all messages and enums in this file are eventually
/// submessages of this message.  So for example, a fuzz test of TestAllTypes
/// could trigger bugs that occur in any message type in this file.  We verify
/// this stays true in a unit test.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TestAllTypesProto3 {
    /// Singular
    pub optional_int32: i32,

    pub optional_int64: i64,

    pub optional_uint32: u32,

    pub optional_uint64: u64,

    pub optional_sint32: i32,

    pub optional_sint64: i64,

    pub optional_fixed32: u32,

    pub optional_fixed64: u64,

    pub optional_sfixed32: i32,

    pub optional_sfixed64: i64,

    pub optional_float: f32,

    pub optional_double: f64,

    pub optional_bool: bool,

    pub optional_string: std::string::String,

    pub optional_bytes: ::bytes::Bytes,

    pub optional_nested_message: std::option::Option<
        std::boxed::Box<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,
    >,

    pub optional_foreign_message:
        std::option::Option<crate::generated::test_protos::ForeignMessage>,

    pub optional_nested_enum: crate::generated::test_protos::test_all_types_proto_3::NestedEnum,

    pub optional_foreign_enum: crate::generated::test_protos::ForeignEnum,

    pub optional_aliased_enum: crate::generated::test_protos::test_all_types_proto_3::AliasedEnum,

    pub optional_string_piece: std::string::String,

    pub optional_cord: std::string::String,

    pub recursive_message:
        std::option::Option<std::boxed::Box<crate::generated::test_protos::TestAllTypesProto3>>,

    /// Repeated
    pub repeated_int32: std::vec::Vec<i32>,

    pub repeated_int64: std::vec::Vec<i64>,

    pub repeated_uint32: std::vec::Vec<u32>,

    pub repeated_uint64: std::vec::Vec<u64>,

    pub repeated_sint32: std::vec::Vec<i32>,

    pub repeated_sint64: std::vec::Vec<i64>,

    pub repeated_fixed32: std::vec::Vec<u32>,

    pub repeated_fixed64: std::vec::Vec<u64>,

    pub repeated_sfixed32: std::vec::Vec<i32>,

    pub repeated_sfixed64: std::vec::Vec<i64>,

    pub repeated_float: std::vec::Vec<f32>,

    pub repeated_double: std::vec::Vec<f64>,

    pub repeated_bool: std::vec::Vec<bool>,

    pub repeated_string: std::vec::Vec<std::string::String>,

    pub repeated_bytes: std::vec::Vec<::bytes::Bytes>,

    pub repeated_nested_message:
        std::vec::Vec<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,

    pub repeated_foreign_message: std::vec::Vec<crate::generated::test_protos::ForeignMessage>,

    pub repeated_nested_enum:
        std::vec::Vec<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,

    pub repeated_foreign_enum: std::vec::Vec<crate::generated::test_protos::ForeignEnum>,

    pub repeated_string_piece: std::vec::Vec<std::string::String>,

    pub repeated_cord: std::vec::Vec<std::string::String>,

    /// Packed
    pub packed_int32: std::vec::Vec<i32>,

    pub packed_int64: std::vec::Vec<i64>,

    pub packed_uint32: std::vec::Vec<u32>,

    pub packed_uint64: std::vec::Vec<u64>,

    pub packed_sint32: std::vec::Vec<i32>,

    pub packed_sint64: std::vec::Vec<i64>,

    pub packed_fixed32: std::vec::Vec<u32>,

    pub packed_fixed64: std::vec::Vec<u64>,

    pub packed_sfixed32: std::vec::Vec<i32>,

    pub packed_sfixed64: std::vec::Vec<i64>,

    pub packed_float: std::vec::Vec<f32>,

    pub packed_double: std::vec::Vec<f64>,

    pub packed_bool: std::vec::Vec<bool>,

    pub packed_nested_enum:
        std::vec::Vec<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,

    /// Unpacked
    pub unpacked_int32: std::vec::Vec<i32>,

    pub unpacked_int64: std::vec::Vec<i64>,

    pub unpacked_uint32: std::vec::Vec<u32>,

    pub unpacked_uint64: std::vec::Vec<u64>,

    pub unpacked_sint32: std::vec::Vec<i32>,

    pub unpacked_sint64: std::vec::Vec<i64>,

    pub unpacked_fixed32: std::vec::Vec<u32>,

    pub unpacked_fixed64: std::vec::Vec<u64>,

    pub unpacked_sfixed32: std::vec::Vec<i32>,

    pub unpacked_sfixed64: std::vec::Vec<i64>,

    pub unpacked_float: std::vec::Vec<f32>,

    pub unpacked_double: std::vec::Vec<f64>,

    pub unpacked_bool: std::vec::Vec<bool>,

    pub unpacked_nested_enum:
        std::vec::Vec<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,

    /// Map
    pub map_int32_int32: std::collections::HashMap<i32, i32>,

    pub map_int64_int64: std::collections::HashMap<i64, i64>,

    pub map_uint32_uint32: std::collections::HashMap<u32, u32>,

    pub map_uint64_uint64: std::collections::HashMap<u64, u64>,

    pub map_sint32_sint32: std::collections::HashMap<i32, i32>,

    pub map_sint64_sint64: std::collections::HashMap<i64, i64>,

    pub map_fixed32_fixed32: std::collections::HashMap<u32, u32>,

    pub map_fixed64_fixed64: std::collections::HashMap<u64, u64>,

    pub map_sfixed32_sfixed32: std::collections::HashMap<i32, i32>,

    pub map_sfixed64_sfixed64: std::collections::HashMap<i64, i64>,

    pub map_int32_float: std::collections::HashMap<i32, f32>,

    pub map_int32_double: std::collections::HashMap<i32, f64>,

    pub map_bool_bool: std::collections::HashMap<bool, bool>,

    pub map_string_string: std::collections::HashMap<std::string::String, std::string::String>,

    pub map_string_bytes: std::collections::HashMap<std::string::String, ::bytes::Bytes>,

    pub map_string_nested_message: std::collections::HashMap<
        std::string::String,
        crate::generated::test_protos::test_all_types_proto_3::NestedMessage,
    >,

    pub map_string_foreign_message: std::collections::HashMap<
        std::string::String,
        crate::generated::test_protos::ForeignMessage,
    >,

    pub map_string_nested_enum: std::collections::HashMap<
        std::string::String,
        crate::generated::test_protos::test_all_types_proto_3::NestedEnum,
    >,

    pub map_string_foreign_enum:
        std::collections::HashMap<std::string::String, crate::generated::test_protos::ForeignEnum>,

    /// Well-known types
    pub optional_bool_wrapper: std::option::Option<wkt::BoolValue>,

    pub optional_int32_wrapper: std::option::Option<wkt::Int32Value>,

    pub optional_int64_wrapper: std::option::Option<wkt::Int64Value>,

    pub optional_uint32_wrapper: std::option::Option<wkt::UInt32Value>,

    pub optional_uint64_wrapper: std::option::Option<wkt::UInt64Value>,

    pub optional_float_wrapper: std::option::Option<wkt::FloatValue>,

    pub optional_double_wrapper: std::option::Option<wkt::DoubleValue>,

    pub optional_string_wrapper: std::option::Option<wkt::StringValue>,

    pub optional_bytes_wrapper: std::option::Option<wkt::BytesValue>,

    pub repeated_bool_wrapper: std::vec::Vec<wkt::BoolValue>,

    pub repeated_int32_wrapper: std::vec::Vec<wkt::Int32Value>,

    pub repeated_int64_wrapper: std::vec::Vec<wkt::Int64Value>,

    pub repeated_uint32_wrapper: std::vec::Vec<wkt::UInt32Value>,

    pub repeated_uint64_wrapper: std::vec::Vec<wkt::UInt64Value>,

    pub repeated_float_wrapper: std::vec::Vec<wkt::FloatValue>,

    pub repeated_double_wrapper: std::vec::Vec<wkt::DoubleValue>,

    pub repeated_string_wrapper: std::vec::Vec<wkt::StringValue>,

    pub repeated_bytes_wrapper: std::vec::Vec<wkt::BytesValue>,

    pub optional_duration: std::option::Option<wkt::Duration>,

    pub optional_timestamp: std::option::Option<wkt::Timestamp>,

    pub optional_field_mask: std::option::Option<wkt::FieldMask>,

    pub optional_struct: std::option::Option<wkt::Struct>,

    pub optional_any: std::option::Option<wkt::Any>,

    pub optional_value: std::option::Option<wkt::Value>,

    pub optional_null_value: wkt::NullValue,

    pub repeated_duration: std::vec::Vec<wkt::Duration>,

    pub repeated_timestamp: std::vec::Vec<wkt::Timestamp>,

    pub repeated_fieldmask: std::vec::Vec<wkt::FieldMask>,

    pub repeated_struct: std::vec::Vec<wkt::Struct>,

    pub repeated_any: std::vec::Vec<wkt::Any>,

    pub repeated_value: std::vec::Vec<wkt::Value>,

    pub repeated_list_value: std::vec::Vec<wkt::ListValue>,

    /// Test field-name-to-JSON-name convention.
    /// (protobuf says names can be any valid C/C++ identifier.)
    pub fieldname1: i32,

    pub field_name2: i32,

    pub _field_name3: i32,

    pub field__name4_: i32,

    pub field0name5: i32,

    pub field_0_name6: i32,

    pub field_name_7: i32,

    pub field_name_8: i32,

    pub field_name_9: i32,

    pub field_name_10: i32,

    pub field_name_11: i32,

    pub field_name_12: i32,

    pub __field_name13: i32,

    pub __field_name_14: i32,

    pub field__name15: i32,

    pub field__name_16: i32,

    pub field_name17__: i32,

    pub field_name_18__: i32,

    pub oneof_field:
        std::option::Option<crate::generated::test_protos::test_all_types_proto_3::OneofField>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TestAllTypesProto3 {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [optional_int32][crate::generated::test_protos::TestAllTypesProto3::optional_int32].
    pub fn set_optional_int32<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.optional_int32 = v.into();
        self
    }

    /// Sets the value of [optional_int64][crate::generated::test_protos::TestAllTypesProto3::optional_int64].
    pub fn set_optional_int64<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.optional_int64 = v.into();
        self
    }

    /// Sets the value of [optional_uint32][crate::generated::test_protos::TestAllTypesProto3::optional_uint32].
    pub fn set_optional_uint32<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
        self.optional_uint32 = v.into();
        self
    }

    /// Sets the value of [optional_uint64][crate::generated::test_protos::TestAllTypesProto3::optional_uint64].
    pub fn set_optional_uint64<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
        self.optional_uint64 = v.into();
        self
    }

    /// Sets the value of [optional_sint32][crate::generated::test_protos::TestAllTypesProto3::optional_sint32].
    pub fn set_optional_sint32<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.optional_sint32 = v.into();
        self
    }

    /// Sets the value of [optional_sint64][crate::generated::test_protos::TestAllTypesProto3::optional_sint64].
    pub fn set_optional_sint64<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.optional_sint64 = v.into();
        self
    }

    /// Sets the value of [optional_fixed32][crate::generated::test_protos::TestAllTypesProto3::optional_fixed32].
    pub fn set_optional_fixed32<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
        self.optional_fixed32 = v.into();
        self
    }

    /// Sets the value of [optional_fixed64][crate::generated::test_protos::TestAllTypesProto3::optional_fixed64].
    pub fn set_optional_fixed64<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
        self.optional_fixed64 = v.into();
        self
    }

    /// Sets the value of [optional_sfixed32][crate::generated::test_protos::TestAllTypesProto3::optional_sfixed32].
    pub fn set_optional_sfixed32<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.optional_sfixed32 = v.into();
        self
    }

    /// Sets the value of [optional_sfixed64][crate::generated::test_protos::TestAllTypesProto3::optional_sfixed64].
    pub fn set_optional_sfixed64<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.optional_sfixed64 = v.into();
        self
    }

    /// Sets the value of [optional_float][crate::generated::test_protos::TestAllTypesProto3::optional_float].
    pub fn set_optional_float<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
        self.optional_float = v.into();
        self
    }

    /// Sets the value of [optional_double][crate::generated::test_protos::TestAllTypesProto3::optional_double].
    pub fn set_optional_double<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.optional_double = v.into();
        self
    }

    /// Sets the value of [optional_bool][crate::generated::test_protos::TestAllTypesProto3::optional_bool].
    pub fn set_optional_bool<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.optional_bool = v.into();
        self
    }

    /// Sets the value of [optional_string][crate::generated::test_protos::TestAllTypesProto3::optional_string].
    pub fn set_optional_string<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.optional_string = v.into();
        self
    }

    /// Sets the value of [optional_bytes][crate::generated::test_protos::TestAllTypesProto3::optional_bytes].
    pub fn set_optional_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.optional_bytes = v.into();
        self
    }

    /// Sets the value of [optional_nested_message][crate::generated::test_protos::TestAllTypesProto3::optional_nested_message].
    pub fn set_optional_nested_message<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,
    {
        self.optional_nested_message = std::option::Option::Some(std::boxed::Box::new(v.into()));
        self
    }

    /// Sets or clears the value of [optional_nested_message][crate::generated::test_protos::TestAllTypesProto3::optional_nested_message].
    pub fn set_or_clear_optional_nested_message<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,
    {
        self.optional_nested_message = v.map(|x| std::boxed::Box::new(x.into()));
        self
    }

    /// Sets the value of [optional_foreign_message][crate::generated::test_protos::TestAllTypesProto3::optional_foreign_message].
    pub fn set_optional_foreign_message<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::generated::test_protos::ForeignMessage>,
    {
        self.optional_foreign_message = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_foreign_message][crate::generated::test_protos::TestAllTypesProto3::optional_foreign_message].
    pub fn set_or_clear_optional_foreign_message<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::generated::test_protos::ForeignMessage>,
    {
        self.optional_foreign_message = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_nested_enum][crate::generated::test_protos::TestAllTypesProto3::optional_nested_enum].
    pub fn set_optional_nested_enum<
        T: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.optional_nested_enum = v.into();
        self
    }

    /// Sets the value of [optional_foreign_enum][crate::generated::test_protos::TestAllTypesProto3::optional_foreign_enum].
    pub fn set_optional_foreign_enum<
        T: std::convert::Into<crate::generated::test_protos::ForeignEnum>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.optional_foreign_enum = v.into();
        self
    }

    /// Sets the value of [optional_aliased_enum][crate::generated::test_protos::TestAllTypesProto3::optional_aliased_enum].
    pub fn set_optional_aliased_enum<
        T: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::AliasedEnum>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.optional_aliased_enum = v.into();
        self
    }

    /// Sets the value of [optional_string_piece][crate::generated::test_protos::TestAllTypesProto3::optional_string_piece].
    pub fn set_optional_string_piece<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.optional_string_piece = v.into();
        self
    }

    /// Sets the value of [optional_cord][crate::generated::test_protos::TestAllTypesProto3::optional_cord].
    pub fn set_optional_cord<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.optional_cord = v.into();
        self
    }

    /// Sets the value of [recursive_message][crate::generated::test_protos::TestAllTypesProto3::recursive_message].
    pub fn set_recursive_message<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::generated::test_protos::TestAllTypesProto3>,
    {
        self.recursive_message = std::option::Option::Some(std::boxed::Box::new(v.into()));
        self
    }

    /// Sets or clears the value of [recursive_message][crate::generated::test_protos::TestAllTypesProto3::recursive_message].
    pub fn set_or_clear_recursive_message<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::generated::test_protos::TestAllTypesProto3>,
    {
        self.recursive_message = v.map(|x| std::boxed::Box::new(x.into()));
        self
    }

    /// Sets the value of [repeated_int32][crate::generated::test_protos::TestAllTypesProto3::repeated_int32].
    pub fn set_repeated_int32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.repeated_int32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_int64][crate::generated::test_protos::TestAllTypesProto3::repeated_int64].
    pub fn set_repeated_int64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.repeated_int64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_uint32][crate::generated::test_protos::TestAllTypesProto3::repeated_uint32].
    pub fn set_repeated_uint32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.repeated_uint32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_uint64][crate::generated::test_protos::TestAllTypesProto3::repeated_uint64].
    pub fn set_repeated_uint64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.repeated_uint64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_sint32][crate::generated::test_protos::TestAllTypesProto3::repeated_sint32].
    pub fn set_repeated_sint32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.repeated_sint32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_sint64][crate::generated::test_protos::TestAllTypesProto3::repeated_sint64].
    pub fn set_repeated_sint64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.repeated_sint64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_fixed32][crate::generated::test_protos::TestAllTypesProto3::repeated_fixed32].
    pub fn set_repeated_fixed32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.repeated_fixed32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_fixed64][crate::generated::test_protos::TestAllTypesProto3::repeated_fixed64].
    pub fn set_repeated_fixed64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.repeated_fixed64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_sfixed32][crate::generated::test_protos::TestAllTypesProto3::repeated_sfixed32].
    pub fn set_repeated_sfixed32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.repeated_sfixed32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_sfixed64][crate::generated::test_protos::TestAllTypesProto3::repeated_sfixed64].
    pub fn set_repeated_sfixed64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.repeated_sfixed64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_float][crate::generated::test_protos::TestAllTypesProto3::repeated_float].
    pub fn set_repeated_float<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<f32>,
    {
        use std::iter::Iterator;
        self.repeated_float = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_double][crate::generated::test_protos::TestAllTypesProto3::repeated_double].
    pub fn set_repeated_double<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<f64>,
    {
        use std::iter::Iterator;
        self.repeated_double = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_bool][crate::generated::test_protos::TestAllTypesProto3::repeated_bool].
    pub fn set_repeated_bool<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<bool>,
    {
        use std::iter::Iterator;
        self.repeated_bool = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_string][crate::generated::test_protos::TestAllTypesProto3::repeated_string].
    pub fn set_repeated_string<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.repeated_string = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_bytes][crate::generated::test_protos::TestAllTypesProto3::repeated_bytes].
    pub fn set_repeated_bytes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<::bytes::Bytes>,
    {
        use std::iter::Iterator;
        self.repeated_bytes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_nested_message][crate::generated::test_protos::TestAllTypesProto3::repeated_nested_message].
    pub fn set_repeated_nested_message<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,
    {
        use std::iter::Iterator;
        self.repeated_nested_message = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_foreign_message][crate::generated::test_protos::TestAllTypesProto3::repeated_foreign_message].
    pub fn set_repeated_foreign_message<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::generated::test_protos::ForeignMessage>,
    {
        use std::iter::Iterator;
        self.repeated_foreign_message = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_nested_enum][crate::generated::test_protos::TestAllTypesProto3::repeated_nested_enum].
    pub fn set_repeated_nested_enum<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,
    {
        use std::iter::Iterator;
        self.repeated_nested_enum = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_foreign_enum][crate::generated::test_protos::TestAllTypesProto3::repeated_foreign_enum].
    pub fn set_repeated_foreign_enum<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::generated::test_protos::ForeignEnum>,
    {
        use std::iter::Iterator;
        self.repeated_foreign_enum = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_string_piece][crate::generated::test_protos::TestAllTypesProto3::repeated_string_piece].
    pub fn set_repeated_string_piece<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.repeated_string_piece = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_cord][crate::generated::test_protos::TestAllTypesProto3::repeated_cord].
    pub fn set_repeated_cord<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.repeated_cord = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_int32][crate::generated::test_protos::TestAllTypesProto3::packed_int32].
    pub fn set_packed_int32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.packed_int32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_int64][crate::generated::test_protos::TestAllTypesProto3::packed_int64].
    pub fn set_packed_int64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.packed_int64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_uint32][crate::generated::test_protos::TestAllTypesProto3::packed_uint32].
    pub fn set_packed_uint32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.packed_uint32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_uint64][crate::generated::test_protos::TestAllTypesProto3::packed_uint64].
    pub fn set_packed_uint64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.packed_uint64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_sint32][crate::generated::test_protos::TestAllTypesProto3::packed_sint32].
    pub fn set_packed_sint32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.packed_sint32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_sint64][crate::generated::test_protos::TestAllTypesProto3::packed_sint64].
    pub fn set_packed_sint64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.packed_sint64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_fixed32][crate::generated::test_protos::TestAllTypesProto3::packed_fixed32].
    pub fn set_packed_fixed32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.packed_fixed32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_fixed64][crate::generated::test_protos::TestAllTypesProto3::packed_fixed64].
    pub fn set_packed_fixed64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.packed_fixed64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_sfixed32][crate::generated::test_protos::TestAllTypesProto3::packed_sfixed32].
    pub fn set_packed_sfixed32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.packed_sfixed32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_sfixed64][crate::generated::test_protos::TestAllTypesProto3::packed_sfixed64].
    pub fn set_packed_sfixed64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.packed_sfixed64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_float][crate::generated::test_protos::TestAllTypesProto3::packed_float].
    pub fn set_packed_float<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<f32>,
    {
        use std::iter::Iterator;
        self.packed_float = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_double][crate::generated::test_protos::TestAllTypesProto3::packed_double].
    pub fn set_packed_double<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<f64>,
    {
        use std::iter::Iterator;
        self.packed_double = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_bool][crate::generated::test_protos::TestAllTypesProto3::packed_bool].
    pub fn set_packed_bool<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<bool>,
    {
        use std::iter::Iterator;
        self.packed_bool = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [packed_nested_enum][crate::generated::test_protos::TestAllTypesProto3::packed_nested_enum].
    pub fn set_packed_nested_enum<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,
    {
        use std::iter::Iterator;
        self.packed_nested_enum = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_int32][crate::generated::test_protos::TestAllTypesProto3::unpacked_int32].
    pub fn set_unpacked_int32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.unpacked_int32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_int64][crate::generated::test_protos::TestAllTypesProto3::unpacked_int64].
    pub fn set_unpacked_int64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.unpacked_int64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_uint32][crate::generated::test_protos::TestAllTypesProto3::unpacked_uint32].
    pub fn set_unpacked_uint32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.unpacked_uint32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_uint64][crate::generated::test_protos::TestAllTypesProto3::unpacked_uint64].
    pub fn set_unpacked_uint64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.unpacked_uint64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_sint32][crate::generated::test_protos::TestAllTypesProto3::unpacked_sint32].
    pub fn set_unpacked_sint32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.unpacked_sint32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_sint64][crate::generated::test_protos::TestAllTypesProto3::unpacked_sint64].
    pub fn set_unpacked_sint64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.unpacked_sint64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_fixed32][crate::generated::test_protos::TestAllTypesProto3::unpacked_fixed32].
    pub fn set_unpacked_fixed32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.unpacked_fixed32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_fixed64][crate::generated::test_protos::TestAllTypesProto3::unpacked_fixed64].
    pub fn set_unpacked_fixed64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.unpacked_fixed64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_sfixed32][crate::generated::test_protos::TestAllTypesProto3::unpacked_sfixed32].
    pub fn set_unpacked_sfixed32<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.unpacked_sfixed32 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_sfixed64][crate::generated::test_protos::TestAllTypesProto3::unpacked_sfixed64].
    pub fn set_unpacked_sfixed64<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.unpacked_sfixed64 = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_float][crate::generated::test_protos::TestAllTypesProto3::unpacked_float].
    pub fn set_unpacked_float<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<f32>,
    {
        use std::iter::Iterator;
        self.unpacked_float = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_double][crate::generated::test_protos::TestAllTypesProto3::unpacked_double].
    pub fn set_unpacked_double<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<f64>,
    {
        use std::iter::Iterator;
        self.unpacked_double = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_bool][crate::generated::test_protos::TestAllTypesProto3::unpacked_bool].
    pub fn set_unpacked_bool<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<bool>,
    {
        use std::iter::Iterator;
        self.unpacked_bool = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [unpacked_nested_enum][crate::generated::test_protos::TestAllTypesProto3::unpacked_nested_enum].
    pub fn set_unpacked_nested_enum<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,
    {
        use std::iter::Iterator;
        self.unpacked_nested_enum = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [map_int32_int32][crate::generated::test_protos::TestAllTypesProto3::map_int32_int32].
    pub fn set_map_int32_int32<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i32>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.map_int32_int32 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_int64_int64][crate::generated::test_protos::TestAllTypesProto3::map_int64_int64].
    pub fn set_map_int64_int64<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i64>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.map_int64_int64 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_uint32_uint32][crate::generated::test_protos::TestAllTypesProto3::map_uint32_uint32].
    pub fn set_map_uint32_uint32<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<u32>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.map_uint32_uint32 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_uint64_uint64][crate::generated::test_protos::TestAllTypesProto3::map_uint64_uint64].
    pub fn set_map_uint64_uint64<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<u64>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.map_uint64_uint64 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_sint32_sint32][crate::generated::test_protos::TestAllTypesProto3::map_sint32_sint32].
    pub fn set_map_sint32_sint32<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i32>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.map_sint32_sint32 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_sint64_sint64][crate::generated::test_protos::TestAllTypesProto3::map_sint64_sint64].
    pub fn set_map_sint64_sint64<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i64>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.map_sint64_sint64 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_fixed32_fixed32][crate::generated::test_protos::TestAllTypesProto3::map_fixed32_fixed32].
    pub fn set_map_fixed32_fixed32<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<u32>,
        V: std::convert::Into<u32>,
    {
        use std::iter::Iterator;
        self.map_fixed32_fixed32 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_fixed64_fixed64][crate::generated::test_protos::TestAllTypesProto3::map_fixed64_fixed64].
    pub fn set_map_fixed64_fixed64<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<u64>,
        V: std::convert::Into<u64>,
    {
        use std::iter::Iterator;
        self.map_fixed64_fixed64 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_sfixed32_sfixed32][crate::generated::test_protos::TestAllTypesProto3::map_sfixed32_sfixed32].
    pub fn set_map_sfixed32_sfixed32<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i32>,
        V: std::convert::Into<i32>,
    {
        use std::iter::Iterator;
        self.map_sfixed32_sfixed32 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_sfixed64_sfixed64][crate::generated::test_protos::TestAllTypesProto3::map_sfixed64_sfixed64].
    pub fn set_map_sfixed64_sfixed64<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i64>,
        V: std::convert::Into<i64>,
    {
        use std::iter::Iterator;
        self.map_sfixed64_sfixed64 = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_int32_float][crate::generated::test_protos::TestAllTypesProto3::map_int32_float].
    pub fn set_map_int32_float<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i32>,
        V: std::convert::Into<f32>,
    {
        use std::iter::Iterator;
        self.map_int32_float = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_int32_double][crate::generated::test_protos::TestAllTypesProto3::map_int32_double].
    pub fn set_map_int32_double<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i32>,
        V: std::convert::Into<f64>,
    {
        use std::iter::Iterator;
        self.map_int32_double = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_bool_bool][crate::generated::test_protos::TestAllTypesProto3::map_bool_bool].
    pub fn set_map_bool_bool<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<bool>,
        V: std::convert::Into<bool>,
    {
        use std::iter::Iterator;
        self.map_bool_bool = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_string_string][crate::generated::test_protos::TestAllTypesProto3::map_string_string].
    pub fn set_map_string_string<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.map_string_string = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_string_bytes][crate::generated::test_protos::TestAllTypesProto3::map_string_bytes].
    pub fn set_map_string_bytes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<::bytes::Bytes>,
    {
        use std::iter::Iterator;
        self.map_string_bytes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_string_nested_message][crate::generated::test_protos::TestAllTypesProto3::map_string_nested_message].
    pub fn set_map_string_nested_message<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,
    {
        use std::iter::Iterator;
        self.map_string_nested_message = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_string_foreign_message][crate::generated::test_protos::TestAllTypesProto3::map_string_foreign_message].
    pub fn set_map_string_foreign_message<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::generated::test_protos::ForeignMessage>,
    {
        use std::iter::Iterator;
        self.map_string_foreign_message =
            v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_string_nested_enum][crate::generated::test_protos::TestAllTypesProto3::map_string_nested_enum].
    pub fn set_map_string_nested_enum<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,
    {
        use std::iter::Iterator;
        self.map_string_nested_enum = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [map_string_foreign_enum][crate::generated::test_protos::TestAllTypesProto3::map_string_foreign_enum].
    pub fn set_map_string_foreign_enum<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::generated::test_protos::ForeignEnum>,
    {
        use std::iter::Iterator;
        self.map_string_foreign_enum = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [optional_bool_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_bool_wrapper].
    pub fn set_optional_bool_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::BoolValue>,
    {
        self.optional_bool_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_bool_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_bool_wrapper].
    pub fn set_or_clear_optional_bool_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::BoolValue>,
    {
        self.optional_bool_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_int32_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_int32_wrapper].
    pub fn set_optional_int32_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Int32Value>,
    {
        self.optional_int32_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_int32_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_int32_wrapper].
    pub fn set_or_clear_optional_int32_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Int32Value>,
    {
        self.optional_int32_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_int64_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_int64_wrapper].
    pub fn set_optional_int64_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Int64Value>,
    {
        self.optional_int64_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_int64_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_int64_wrapper].
    pub fn set_or_clear_optional_int64_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Int64Value>,
    {
        self.optional_int64_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_uint32_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_uint32_wrapper].
    pub fn set_optional_uint32_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::UInt32Value>,
    {
        self.optional_uint32_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_uint32_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_uint32_wrapper].
    pub fn set_or_clear_optional_uint32_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::UInt32Value>,
    {
        self.optional_uint32_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_uint64_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_uint64_wrapper].
    pub fn set_optional_uint64_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::UInt64Value>,
    {
        self.optional_uint64_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_uint64_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_uint64_wrapper].
    pub fn set_or_clear_optional_uint64_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::UInt64Value>,
    {
        self.optional_uint64_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_float_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_float_wrapper].
    pub fn set_optional_float_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FloatValue>,
    {
        self.optional_float_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_float_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_float_wrapper].
    pub fn set_or_clear_optional_float_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FloatValue>,
    {
        self.optional_float_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_double_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_double_wrapper].
    pub fn set_optional_double_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::DoubleValue>,
    {
        self.optional_double_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_double_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_double_wrapper].
    pub fn set_or_clear_optional_double_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::DoubleValue>,
    {
        self.optional_double_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_string_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_string_wrapper].
    pub fn set_optional_string_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::StringValue>,
    {
        self.optional_string_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_string_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_string_wrapper].
    pub fn set_or_clear_optional_string_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::StringValue>,
    {
        self.optional_string_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_bytes_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_bytes_wrapper].
    pub fn set_optional_bytes_wrapper<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::BytesValue>,
    {
        self.optional_bytes_wrapper = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_bytes_wrapper][crate::generated::test_protos::TestAllTypesProto3::optional_bytes_wrapper].
    pub fn set_or_clear_optional_bytes_wrapper<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::BytesValue>,
    {
        self.optional_bytes_wrapper = v.map(|x| x.into());
        self
    }

    /// Sets the value of [repeated_bool_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_bool_wrapper].
    pub fn set_repeated_bool_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::BoolValue>,
    {
        use std::iter::Iterator;
        self.repeated_bool_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_int32_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_int32_wrapper].
    pub fn set_repeated_int32_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::Int32Value>,
    {
        use std::iter::Iterator;
        self.repeated_int32_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_int64_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_int64_wrapper].
    pub fn set_repeated_int64_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::Int64Value>,
    {
        use std::iter::Iterator;
        self.repeated_int64_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_uint32_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_uint32_wrapper].
    pub fn set_repeated_uint32_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::UInt32Value>,
    {
        use std::iter::Iterator;
        self.repeated_uint32_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_uint64_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_uint64_wrapper].
    pub fn set_repeated_uint64_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::UInt64Value>,
    {
        use std::iter::Iterator;
        self.repeated_uint64_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_float_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_float_wrapper].
    pub fn set_repeated_float_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::FloatValue>,
    {
        use std::iter::Iterator;
        self.repeated_float_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_double_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_double_wrapper].
    pub fn set_repeated_double_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::DoubleValue>,
    {
        use std::iter::Iterator;
        self.repeated_double_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_string_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_string_wrapper].
    pub fn set_repeated_string_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::StringValue>,
    {
        use std::iter::Iterator;
        self.repeated_string_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_bytes_wrapper][crate::generated::test_protos::TestAllTypesProto3::repeated_bytes_wrapper].
    pub fn set_repeated_bytes_wrapper<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::BytesValue>,
    {
        use std::iter::Iterator;
        self.repeated_bytes_wrapper = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [optional_duration][crate::generated::test_protos::TestAllTypesProto3::optional_duration].
    pub fn set_optional_duration<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.optional_duration = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_duration][crate::generated::test_protos::TestAllTypesProto3::optional_duration].
    pub fn set_or_clear_optional_duration<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.optional_duration = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_timestamp][crate::generated::test_protos::TestAllTypesProto3::optional_timestamp].
    pub fn set_optional_timestamp<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.optional_timestamp = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_timestamp][crate::generated::test_protos::TestAllTypesProto3::optional_timestamp].
    pub fn set_or_clear_optional_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.optional_timestamp = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_field_mask][crate::generated::test_protos::TestAllTypesProto3::optional_field_mask].
    pub fn set_optional_field_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.optional_field_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_field_mask][crate::generated::test_protos::TestAllTypesProto3::optional_field_mask].
    pub fn set_or_clear_optional_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.optional_field_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_struct][crate::generated::test_protos::TestAllTypesProto3::optional_struct].
    pub fn set_optional_struct<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Struct>,
    {
        self.optional_struct = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_struct][crate::generated::test_protos::TestAllTypesProto3::optional_struct].
    pub fn set_or_clear_optional_struct<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Struct>,
    {
        self.optional_struct = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_any][crate::generated::test_protos::TestAllTypesProto3::optional_any].
    pub fn set_optional_any<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Any>,
    {
        self.optional_any = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_any][crate::generated::test_protos::TestAllTypesProto3::optional_any].
    pub fn set_or_clear_optional_any<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Any>,
    {
        self.optional_any = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_value][crate::generated::test_protos::TestAllTypesProto3::optional_value].
    pub fn set_optional_value<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Value>,
    {
        self.optional_value = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [optional_value][crate::generated::test_protos::TestAllTypesProto3::optional_value].
    pub fn set_or_clear_optional_value<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Value>,
    {
        self.optional_value = v.map(|x| x.into());
        self
    }

    /// Sets the value of [optional_null_value][crate::generated::test_protos::TestAllTypesProto3::optional_null_value].
    pub fn set_optional_null_value<T: std::convert::Into<wkt::NullValue>>(mut self, v: T) -> Self {
        self.optional_null_value = v.into();
        self
    }

    /// Sets the value of [repeated_duration][crate::generated::test_protos::TestAllTypesProto3::repeated_duration].
    pub fn set_repeated_duration<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::Duration>,
    {
        use std::iter::Iterator;
        self.repeated_duration = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_timestamp][crate::generated::test_protos::TestAllTypesProto3::repeated_timestamp].
    pub fn set_repeated_timestamp<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::Timestamp>,
    {
        use std::iter::Iterator;
        self.repeated_timestamp = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_fieldmask][crate::generated::test_protos::TestAllTypesProto3::repeated_fieldmask].
    pub fn set_repeated_fieldmask<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::FieldMask>,
    {
        use std::iter::Iterator;
        self.repeated_fieldmask = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_struct][crate::generated::test_protos::TestAllTypesProto3::repeated_struct].
    pub fn set_repeated_struct<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::Struct>,
    {
        use std::iter::Iterator;
        self.repeated_struct = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_any][crate::generated::test_protos::TestAllTypesProto3::repeated_any].
    pub fn set_repeated_any<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::Any>,
    {
        use std::iter::Iterator;
        self.repeated_any = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_value][crate::generated::test_protos::TestAllTypesProto3::repeated_value].
    pub fn set_repeated_value<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::Value>,
    {
        use std::iter::Iterator;
        self.repeated_value = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [repeated_list_value][crate::generated::test_protos::TestAllTypesProto3::repeated_list_value].
    pub fn set_repeated_list_value<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::ListValue>,
    {
        use std::iter::Iterator;
        self.repeated_list_value = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [fieldname1][crate::generated::test_protos::TestAllTypesProto3::fieldname1].
    pub fn set_fieldname1<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.fieldname1 = v.into();
        self
    }

    /// Sets the value of [field_name2][crate::generated::test_protos::TestAllTypesProto3::field_name2].
    pub fn set_field_name2<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name2 = v.into();
        self
    }

    /// Sets the value of [_field_name3][crate::generated::test_protos::TestAllTypesProto3::_field_name3].
    pub fn set__field_name3<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self._field_name3 = v.into();
        self
    }

    /// Sets the value of [field__name4_][crate::generated::test_protos::TestAllTypesProto3::field__name4_].
    pub fn set_field__name4_<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field__name4_ = v.into();
        self
    }

    /// Sets the value of [field0name5][crate::generated::test_protos::TestAllTypesProto3::field0name5].
    pub fn set_field0name5<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field0name5 = v.into();
        self
    }

    /// Sets the value of [field_0_name6][crate::generated::test_protos::TestAllTypesProto3::field_0_name6].
    pub fn set_field_0_name6<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_0_name6 = v.into();
        self
    }

    /// Sets the value of [field_name_7][crate::generated::test_protos::TestAllTypesProto3::field_name_7].
    pub fn set_field_name_7<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name_7 = v.into();
        self
    }

    /// Sets the value of [field_name_8][crate::generated::test_protos::TestAllTypesProto3::field_name_8].
    pub fn set_field_name_8<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name_8 = v.into();
        self
    }

    /// Sets the value of [field_name_9][crate::generated::test_protos::TestAllTypesProto3::field_name_9].
    pub fn set_field_name_9<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name_9 = v.into();
        self
    }

    /// Sets the value of [field_name_10][crate::generated::test_protos::TestAllTypesProto3::field_name_10].
    pub fn set_field_name_10<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name_10 = v.into();
        self
    }

    /// Sets the value of [field_name_11][crate::generated::test_protos::TestAllTypesProto3::field_name_11].
    pub fn set_field_name_11<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name_11 = v.into();
        self
    }

    /// Sets the value of [field_name_12][crate::generated::test_protos::TestAllTypesProto3::field_name_12].
    pub fn set_field_name_12<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name_12 = v.into();
        self
    }

    /// Sets the value of [__field_name13][crate::generated::test_protos::TestAllTypesProto3::__field_name13].
    pub fn set___field_name13<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.__field_name13 = v.into();
        self
    }

    /// Sets the value of [__field_name_14][crate::generated::test_protos::TestAllTypesProto3::__field_name_14].
    pub fn set___field_name_14<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.__field_name_14 = v.into();
        self
    }

    /// Sets the value of [field__name15][crate::generated::test_protos::TestAllTypesProto3::field__name15].
    pub fn set_field__name15<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field__name15 = v.into();
        self
    }

    /// Sets the value of [field__name_16][crate::generated::test_protos::TestAllTypesProto3::field__name_16].
    pub fn set_field__name_16<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field__name_16 = v.into();
        self
    }

    /// Sets the value of [field_name17__][crate::generated::test_protos::TestAllTypesProto3::field_name17__].
    pub fn set_field_name17__<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name17__ = v.into();
        self
    }

    /// Sets the value of [field_name_18__][crate::generated::test_protos::TestAllTypesProto3::field_name_18__].
    pub fn set_field_name_18__<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.field_name_18__ = v.into();
        self
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field].
    ///
    /// Note that all the setters affecting `oneof_field` are mutually
    /// exclusive.
    pub fn set_oneof_field<
        T: std::convert::Into<
                std::option::Option<
                    crate::generated::test_protos::test_all_types_proto_3::OneofField,
                >,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.oneof_field = v.into();
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofUint32`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_uint32(&self) -> std::option::Option<&u32> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofUint32(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofUint32`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_uint32<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofUint32(
                v.into(),
            ),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofNestedMessage`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_nested_message(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,
    > {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofNestedMessage(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofNestedMessage`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_nested_message<
        T: std::convert::Into<
                std::boxed::Box<
                    crate::generated::test_protos::test_all_types_proto_3::NestedMessage,
                >,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofNestedMessage(
                v.into(),
            ),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofString`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_string(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofString(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofString`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_string<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofString(
                v.into(),
            ),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofBytes`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_bytes(&self) -> std::option::Option<&::bytes::Bytes> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofBytes(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofBytes`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofBytes(v.into()),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofBool`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_bool(&self) -> std::option::Option<&bool> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofBool(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofBool`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_bool<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofBool(v.into()),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofUint64`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_uint64(&self) -> std::option::Option<&u64> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofUint64(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofUint64`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_uint64<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofUint64(
                v.into(),
            ),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofFloat`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_float(&self) -> std::option::Option<&f32> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofFloat(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofFloat`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_float<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofFloat(v.into()),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofDouble`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_double(&self) -> std::option::Option<&f64> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofDouble(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofDouble`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_double<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofDouble(
                v.into(),
            ),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofEnum`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_enum(
        &self,
    ) -> std::option::Option<&crate::generated::test_protos::test_all_types_proto_3::NestedEnum>
    {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofEnum(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofEnum`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_enum<
        T: std::convert::Into<crate::generated::test_protos::test_all_types_proto_3::NestedEnum>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofEnum(v.into()),
        );
        self
    }

    /// The value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// if it holds a `OneofNullValue`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oneof_null_value(&self) -> std::option::Option<&wkt::NullValue> {
        #[allow(unreachable_patterns)]
        self.oneof_field.as_ref().and_then(|v| match v {
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofNullValue(
                v,
            ) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [oneof_field][crate::generated::test_protos::TestAllTypesProto3::oneof_field]
    /// to hold a `OneofNullValue`.
    ///
    /// Note that all the setters affecting `oneof_field` are
    /// mutually exclusive.
    pub fn set_oneof_null_value<T: std::convert::Into<wkt::NullValue>>(mut self, v: T) -> Self {
        self.oneof_field = std::option::Option::Some(
            crate::generated::test_protos::test_all_types_proto_3::OneofField::OneofNullValue(
                v.into(),
            ),
        );
        self
    }
}

impl wkt::message::Message for TestAllTypesProto3 {
    fn typename() -> &'static str {
        "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3"
    }
}

/// Defines additional types related to [TestAllTypesProto3].
pub mod test_all_types_proto_3 {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct NestedMessage {
        pub a: i32,

        pub corecursive:
            std::option::Option<std::boxed::Box<crate::generated::test_protos::TestAllTypesProto3>>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl NestedMessage {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [a][crate::generated::test_protos::test_all_types_proto_3::NestedMessage::a].
        pub fn set_a<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.a = v.into();
            self
        }

        /// Sets the value of [corecursive][crate::generated::test_protos::test_all_types_proto_3::NestedMessage::corecursive].
        pub fn set_corecursive<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::generated::test_protos::TestAllTypesProto3>,
        {
            self.corecursive = std::option::Option::Some(std::boxed::Box::new(v.into()));
            self
        }

        /// Sets or clears the value of [corecursive][crate::generated::test_protos::test_all_types_proto_3::NestedMessage::corecursive].
        pub fn set_or_clear_corecursive<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::generated::test_protos::TestAllTypesProto3>,
        {
            self.corecursive = v.map(|x| std::boxed::Box::new(x.into()));
            self
        }
    }

    impl wkt::message::Message for NestedMessage {
        fn typename() -> &'static str {
            "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage"
        }
    }

    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum NestedEnum {
        Foo,
        Bar,
        Baz,
        Neg,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [NestedEnum::value] or
        /// [NestedEnum::name].
        UnknownValue(nested_enum::UnknownValue),
    }

    #[doc(hidden)]
    pub mod nested_enum {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl NestedEnum {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Foo => std::option::Option::Some(0),
                Self::Bar => std::option::Option::Some(1),
                Self::Baz => std::option::Option::Some(2),
                Self::Neg => std::option::Option::Some(-1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Foo => std::option::Option::Some("FOO"),
                Self::Bar => std::option::Option::Some("BAR"),
                Self::Baz => std::option::Option::Some("BAZ"),
                Self::Neg => std::option::Option::Some("NEG"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for NestedEnum {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for NestedEnum {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for NestedEnum {
        fn from(value: i32) -> Self {
            match value {
                -1 => Self::Neg,
                0 => Self::Foo,
                1 => Self::Bar,
                2 => Self::Baz,
                _ => Self::UnknownValue(nested_enum::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for NestedEnum {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "FOO" => Self::Foo,
                "BAR" => Self::Bar,
                "BAZ" => Self::Baz,
                "NEG" => Self::Neg,
                _ => Self::UnknownValue(nested_enum::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for NestedEnum {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Foo => serializer.serialize_i32(0),
                Self::Bar => serializer.serialize_i32(1),
                Self::Baz => serializer.serialize_i32(2),
                Self::Neg => serializer.serialize_i32(-1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for NestedEnum {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<NestedEnum>::new(
                ".protobuf_test_messages.proto3.TestAllTypesProto3.NestedEnum",
            ))
        }
    }

    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum AliasedEnum {
        AliasFoo,
        AliasBar,
        AliasBaz,
        Moo,
        BAz,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [AliasedEnum::value] or
        /// [AliasedEnum::name].
        UnknownValue(aliased_enum::UnknownValue),
    }

    #[doc(hidden)]
    pub mod aliased_enum {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl AliasedEnum {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::AliasFoo => std::option::Option::Some(0),
                Self::AliasBar => std::option::Option::Some(1),
                Self::AliasBaz => std::option::Option::Some(2),
                Self::Moo => std::option::Option::Some(2),
                Self::BAz => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::AliasFoo => std::option::Option::Some("ALIAS_FOO"),
                Self::AliasBar => std::option::Option::Some("ALIAS_BAR"),
                Self::AliasBaz => std::option::Option::Some("ALIAS_BAZ"),
                Self::Moo => std::option::Option::Some("MOO"),
                Self::BAz => std::option::Option::Some("bAz"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for AliasedEnum {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for AliasedEnum {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for AliasedEnum {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::AliasFoo,
                1 => Self::AliasBar,
                2 => Self::Moo,
                _ => Self::UnknownValue(aliased_enum::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for AliasedEnum {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "ALIAS_FOO" => Self::AliasFoo,
                "ALIAS_BAR" => Self::AliasBar,
                "ALIAS_BAZ" => Self::AliasBaz,
                "MOO" => Self::Moo,
                "moo" => Self::Moo,
                "bAz" => Self::BAz,
                _ => Self::UnknownValue(aliased_enum::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for AliasedEnum {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::AliasFoo => serializer.serialize_i32(0),
                Self::AliasBar => serializer.serialize_i32(1),
                Self::AliasBaz => serializer.serialize_i32(2),
                Self::Moo => serializer.serialize_i32(2),
                Self::BAz => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for AliasedEnum {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AliasedEnum>::new(
                ".protobuf_test_messages.proto3.TestAllTypesProto3.AliasedEnum",
            ))
        }
    }

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum OneofField {
        OneofUint32(u32),
        OneofNestedMessage(
            std::boxed::Box<crate::generated::test_protos::test_all_types_proto_3::NestedMessage>,
        ),
        OneofString(std::string::String),
        OneofBytes(::bytes::Bytes),
        OneofBool(bool),
        OneofUint64(u64),
        OneofFloat(f32),
        OneofDouble(f64),
        OneofEnum(crate::generated::test_protos::test_all_types_proto_3::NestedEnum),
        OneofNullValue(wkt::NullValue),
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ForeignMessage {
    pub c: i32,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ForeignMessage {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [c][crate::generated::test_protos::ForeignMessage::c].
    pub fn set_c<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.c = v.into();
        self
    }
}

impl wkt::message::Message for ForeignMessage {
    fn typename() -> &'static str {
        "type.googleapis.com/protobuf_test_messages.proto3.ForeignMessage"
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NullHypothesisProto3 {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NullHypothesisProto3 {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for NullHypothesisProto3 {
    fn typename() -> &'static str {
        "type.googleapis.com/protobuf_test_messages.proto3.NullHypothesisProto3"
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnumOnlyProto3 {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EnumOnlyProto3 {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for EnumOnlyProto3 {
    fn typename() -> &'static str {
        "type.googleapis.com/protobuf_test_messages.proto3.EnumOnlyProto3"
    }
}

/// Defines additional types related to [EnumOnlyProto3].
pub mod enum_only_proto_3 {
    #[allow(unused_imports)]
    use super::*;

    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Bool {
        KFalse,
        KTrue,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Bool::value] or
        /// [Bool::name].
        UnknownValue(bool::UnknownValue),
    }

    #[doc(hidden)]
    pub mod bool {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Bool {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::KFalse => std::option::Option::Some(0),
                Self::KTrue => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::KFalse => std::option::Option::Some("kFalse"),
                Self::KTrue => std::option::Option::Some("kTrue"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Bool {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Bool {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Bool {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::KFalse,
                1 => Self::KTrue,
                _ => Self::UnknownValue(bool::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Bool {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "kFalse" => Self::KFalse,
                "kTrue" => Self::KTrue,
                _ => Self::UnknownValue(bool::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Bool {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::KFalse => serializer.serialize_i32(0),
                Self::KTrue => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Bool {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Bool>::new(
                ".protobuf_test_messages.proto3.EnumOnlyProto3.Bool",
            ))
        }
    }
}

///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ForeignEnum {
    ForeignFoo,
    ForeignBar,
    ForeignBaz,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [ForeignEnum::value] or
    /// [ForeignEnum::name].
    UnknownValue(foreign_enum::UnknownValue),
}

#[doc(hidden)]
pub mod foreign_enum {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl ForeignEnum {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::ForeignFoo => std::option::Option::Some(0),
            Self::ForeignBar => std::option::Option::Some(1),
            Self::ForeignBaz => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::ForeignFoo => std::option::Option::Some("FOREIGN_FOO"),
            Self::ForeignBar => std::option::Option::Some("FOREIGN_BAR"),
            Self::ForeignBaz => std::option::Option::Some("FOREIGN_BAZ"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for ForeignEnum {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for ForeignEnum {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for ForeignEnum {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::ForeignFoo,
            1 => Self::ForeignBar,
            2 => Self::ForeignBaz,
            _ => Self::UnknownValue(foreign_enum::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for ForeignEnum {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "FOREIGN_FOO" => Self::ForeignFoo,
            "FOREIGN_BAR" => Self::ForeignBar,
            "FOREIGN_BAZ" => Self::ForeignBaz,
            _ => Self::UnknownValue(foreign_enum::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for ForeignEnum {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::ForeignFoo => serializer.serialize_i32(0),
            Self::ForeignBar => serializer.serialize_i32(1),
            Self::ForeignBaz => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for ForeignEnum {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForeignEnum>::new(
            ".protobuf_test_messages.proto3.ForeignEnum",
        ))
    }
}
